package org.grow.leavejpa.exception;

import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * @Author: xwg
 * @CreateDate: 21-6-8
 */
@RestControllerAdvice
public class ExceptionBridge {

    @ExceptionHandler(JulyException.class)
    public ResponseEntity<String> julyException(JulyException e){
        return new ResponseEntity<>(e.getMessage(),null,e.getCode());
    }

//    @ExceptionHandler(Exception.class)
//    public ResponseEntity<String> exception(Exception e){
//        return new ResponseEntity<>(e.getMessage(),null,1024);
//    }
}
